﻿
function DeleteArticle(docId) {
    $.messager.confirm('删除', '确定要删除该文章吗?', function (r) {
        if (r) {
            $.ajax({
                url: "~/News/DeleteArticle/" + docId,
                type: "DELETE",
                success: function (e) {
                    if (e.Result) {
                        location.reload();
                    } else {
                        $.messager.alert('删除失败', '删除失败!', 'error');
                    }
                },
                error: function (e) {
                    alert("error:" + e);
                }
            });
        }
    });
}

function on_page_change(pageNumber, pageSize) {
    $.get("~/News/ArticleIndex?page=" + pageNumber+"&rows=" + pageSize, function (e) {
        var tp = $(".article-list");
        var np = $(e);
        tp.children().remove();
        np.find(".article-list").children().appendTo($(".article-list"));
    })
}
